#include "productui.h"
#include "ui_productui.h"

ProductUi::ProductUi(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ProductUi)
{
    ui->setupUi(this);
    SetLabels();

}

ProductUi::~ProductUi()
{
    delete ui;
}

void ProductUi::SetLabels()
{
    ui->label->setText("Product");
    ui->label_2->setText("Sale Quantity");
    ui->label_3->setText("Rating");
    ui->label_4->setText("Sell Price");
    ui->label_5->setText("Cost");
}

void ProductUi::SetValues(QString productName, int quantity, int rating, float price, float cost)
{
    ui->lineEdit->setText(productName);
    ui->spinBox->setValue(quantity);
    ui->doubleSpinBox->setValue(rating);
    ui->doubleSpinBox_2->setValue(price/100);
    ui->doubleSpinBox_3->setValue(cost/100);

}
